﻿<!-- BEGIN MAIN CONTENT -->
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN: ACCORDION DEMO -->
        <div class="portlet light">
            <div class="portlet-title page-bar">
                <ul class="page-breadcrumb pull-right">
                    <li>
                        <i class="fa fa-home"></i>
                        <a href="#/home.html">管理中心</a>
                        <i class="fa fa-angle-right"></i>
                    </li>
                    <li>
                        <a href="#/GgcmsAdsList.html">广告管理</a>
                        <i class="fa fa-angle-right"></i>
                    </li>
                    <li>
                        <a href="javascript:;" data-ng-bind="$state.current.data.pageTitle"></a>
                    </li>
                </ul>
                <div class="caption font-green-sharp">
                    <i class="icon-note font-green-sharp"></i>
                    <span class="caption-subject bold uppercase" data-ng-bind="$state.current.data.pageTitle"></span>
                </div>
            </div>
            <div class="portlet-body">
                <div class="row">
                    <div class="col-xs-12">
                        <form class="form-horizontal" name="ggcmsForm" role="form" novalidate>
                            <input type="hidden" ng-model="data.Id">
                            <div class="form-body">
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Title.$invalid&&!ggcmsForm.Title.$pristine}">
                                    <label class="col-md-3 control-label">标题:</label>
                                    <div class="col-md-9">
                                        <input type="text" name="Title" minlength="2" maxlength="30" class="form-control" placeholder="请输入标题" required ng-model="data.Title">
                                        <div class="help-block" ng-show="ggcmsForm.Title.$invalid&&!ggcmsForm.Title.$pristine"> 请输入标题 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.btnSelectLogo.$invalid&&!ggcmsForm.btnSelectLogo.$pristine}">
                                    <label class="col-md-3 control-label">图片:</label>
                                    <div class="col-md-9">
                                        <input type="text" class="form-control input-medium inline-block" ng-model="data.Imgurl" name="Imgurl" id="Imgurl" placeholder="可以直接填写Url地址" />
                                        <button class="btn blue" type="button" ngf-select="editSvr.fileUpload($file,'Imgurl')" ng-model="currentInfo.btnSelectLogo" name="btnSelectLogo" ngf-pattern="'image/*'" ngf-accept="'image/*'" ngf-max-size="200KB"> <i class="icon-picture"></i> 选择图片 </button>
                                        <button class="btn green" type="button" name="btnPreviewLogo" ng-if="data.Imgurl" ng-click="editSvr.filePreview('Imgurl')"> <i class="icon-eye"></i> 预览 </button>
                                        <button class="btn red" type="button" name="btnClearLogo" ng-if="data.Imgurl" ng-click="editSvr.fileClear('Imgurl')"> <i class="icon-trash"></i> 清除 </button>
                                        <div class="help-block" ng-show="ggcmsForm.btnSelectLogo.$invalid&&!ggcmsForm.btnSelectLogo.$pristine"> 只能上传小于200kb的图片 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Adtype.$invalid&&!ggcmsForm.Adtype.$pristine}">
                                    <label class="col-md-3 control-label">类型:</label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="Adtype" id="Adtype" ng-model="data.Adtype" ng-options="kv.type as kv.name for kv in sysDicts.adsType"></select>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Sortid.$invalid&&!ggcmsForm.Sortid.$pristine}">
                                    <label class="col-md-3 control-label">排序:</label>
                                    <div class="col-md-9">
                                        <input type="number" name="Sortid" min="0" maxlength="100" class="form-control" placeholder="数字越小越靠前" ng-model="data.Sortid">
                                        <div class="help-block" ng-show="ggcmsForm.Sortid.$invalid&&!ggcmsForm.Sortid.$pristine"> 数字越小越靠前 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Status.$invalid&&!ggcmsForm.Status.$pristine}">
                                    <label class="col-md-3 control-label">状态:</label>
                                    <div class="col-md-9">
                                        <select class="form-control" name="Status" id="Status" ng-model="data.Status" ng-options="kv.type as kv.name for kv in sysDicts.adsStatus"></select>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Describe.$invalid&&!ggcmsForm.Describe.$pristine}">
                                    <label class="col-md-3 control-label">描述:</label>
                                    <div class="col-md-9">
                                        <textarea name="Describe" id="Describe" maxlength="255" rows="4" class="form-control" placeholder="描述信息" ng-model="data.Describe"></textarea>
                                        <div class="help-block" ng-show="ggcmsForm.Describe.$invalid&&!ggcmsForm.Describe.$pristine"> 描述: </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.AdsCode.$invalid&&!ggcmsForm.AdsCode.$pristine}" ng-if="data.Adtype==3">
                                    <label class="col-md-3 control-label">脚本代码:</label>
                                    <div class="col-md-9">
                                        <textarea name="AdsCode" id="AdsCode" maxlength="255" rows="4" class="form-control" placeholder="脚本代码" ng-model="data.AdsCode"></textarea>
                                        <div class="help-block" ng-show="ggcmsForm.AdsCode.$invalid&&!ggcmsForm.AdsCode.$pristine"> 脚本代码 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Extattr1.$invalid&&!ggcmsForm.Extattr1.$pristine}">
                                    <label class="col-md-3 control-label">附加字段1:</label>
                                    <div class="col-md-9">
                                        <input type="text" name="Extattr1" minlength="2" maxlength="30" class="form-control" placeholder="附加字段1" ng-model="data.Extattr1">
                                        <div class="help-block" ng-show="ggcmsForm.Extattr1.$invalid&&!ggcmsForm.Extattr1.$pristine"> 附加字段1 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Extattr2.$invalid&&!ggcmsForm.Extattr2.$pristine}">
                                    <label class="col-md-3 control-label">附加字段2:</label>
                                    <div class="col-md-9">
                                        <input type="text" name="Extattr2" minlength="2" maxlength="30" class="form-control" placeholder="附加字段2" ng-model="data.Extattr2">
                                        <div class="help-block" ng-show="ggcmsForm.Extattr2.$invalid&&!ggcmsForm.Extattr2.$pristine"> 附加字段2 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Extattr3.$invalid&&!ggcmsForm.Extattr3.$pristine}">
                                    <label class="col-md-3 control-label">附加字段3:</label>
                                    <div class="col-md-9">
                                        <input type="text" name="Extattr3" minlength="2" maxlength="30" class="form-control" placeholder="附加字段3" ng-model="data.Extattr3">
                                        <div class="help-block" ng-show="ggcmsForm.Extattr3.$invalid&&!ggcmsForm.Extattr3.$pristine"> 附加字段3 </div>
                                    </div>
                                </div>
                                <div class="form-group" ng-class="{'has-error' : ggcmsForm.Tourl.$invalid&&!ggcmsForm.Tourl.$pristine}">
                                    <label class="col-md-3 control-label">跳转URL:</label>
                                    <div class="col-md-9">
                                        <input type="text" name="Tourl" minlength="2" maxlength="30" class="form-control" placeholder="跳转URL" ng-model="data.Tourl">
                                        <div class="help-block" ng-show="ggcmsForm.Tourl.$invalid&&!ggcmsForm.Tourl.$pristine"> 跳转URL </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-actions">
                                <hr/>
                                <div class="row">
                                    <div class="col-md-12 text-center">
                                        <button class="btn green" ng-click="saveData(data)" ng-disabled="ggcmsForm.$invalid||saveing"> <span class="fa fa-save"></span> 保存</button>
                                    </div>
                                </div>
                            </div>
                        </form>

                    </div>
                </div>
            </div>
        </div>
        <!-- END: ACCORDION DEMO -->
    </div>
</div>
<!-- END MAIN CONTENT -->
<pic-pre-view url="currentInfo.pic" close="editSvr.previewClose()" ng-if="currentInfo.picShow"></pic-pre-view>